<?php

namespace api\channel\jutuike;

use api\channel\ExtendChannleBase;
use app\model\BaseSupplier;
use think\Exception;

class ActivityJutuikeChannle extends Union
{
    public $pubId;

    public function __construct()
    {
        $obj = BaseSupplier::where('code', BaseSupplier::CODE_JUTUIKE_ACTIVITY)
            ->find();

        $this->supplierInfo = $obj;

        if (empty($obj) || empty($this->supplierInfo->api_config['apikey']) || empty($this->supplierInfo->api_config['pubId'])){
            throw new Exception('聚推客活动数据不存在');
        }

        $this->apikey = $this->supplierInfo->api_config['apikey'];
        $this->pubId = $this->supplierInfo->api_config['pubId'];
//        $this->baseUrl = 'http://api.act.jutuike.com';
    }
}